﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterAdmin.master" AutoEventWireup="true" CodeFile="ThongKe.aspx.cs" Inherits="WebFormThongKe" %>

<%@ Register Src="~/UC_Admin/UCAdminIndex.ascx" TagPrefix="uc1" TagName="UCAdminIndex" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <uc1:UCAdminIndex runat="server" ID="UCAdminIndex" />
     <link rel="stylesheet" href="../Styles/Admin/jquery-ui-1.10.3.custom.min.css" />
    <script type="text/javascript" src="../Styles/Admin/jquery-ui-1.10.3.custom.min.js"></script>
    <script src="../Styles/Admin/jquery.mtz.monthpicker.js"></script>
    <script type="text/javascript">

        jQuery(function () {
            var startYear = parseInt(<%=DateTime.Now.Year-20%>);
            var endYear = parseInt(<%=DateTime.Now.Year%>);

            options = {
                pattern: 'mm/yyyy',
                selectedYear: endYear,
                startYear: startYear,
                finalYear: endYear,
                monthNames: ['Jan', 'Fev', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
            };

            jQuery('#<%=txtMonth.ClientID%>').monthpicker(options);
        });

    </script>
    <style type="text/css">
    .auto-style1 {
        width: 100%;
    }
    .auto-style2 {
        width: 472px;
    }
        .auto-style3 {
            height: 33px;
        }
        .auto-style4 {
            height: 30px;
        }
        .auto-style7 {
            height: 33px;
            color: #000000;
        }
        .auto-style8 {
            width: 472px;
            color: #3366FF;
        }
        .auto-style9 {
            color: #000000;
        }
        .auto-style10 {
            width: 178px;
        }
        .auto-style11 {
            height: 30px;
            width: 178px;
        }
        .auto-style12 {
            width: 472px;
            height: 38px;
            font-size: medium;
        }
    </style>

<div>
    <table class="auto-style1">
        <tr>
            <td class="auto-style8" rowspan="6">
        <table cellspacing="10px">
            <tr>
                <td class="auto-style7">Lọai thống kê</td>
                <td class="auto-style3">
                    <asp:DropDownList ID="ddlType" runat="server">
                        <asp:ListItem Text="Thống kê theo sách" Value="1"/>
                        <asp:ListItem Text="Thống kê theo loại sách" Value="2"/>
                        <asp:ListItem Text="Thống kê theo khách hàng" Value="3"/>
                        <asp:ListItem Value="4">Thống kê theo doanh thu</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="auto-style9">Thời điểm thống kê
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtMonth"/>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <asp:Button ID="btnXemThongKe" Text="Xem thống kê" runat="server" CssClass="btn btn-primary" OnClick="btnXemThongKe_Click"/><br class="auto-style9" />
                    <asp:Label ID="lblMsg" Text="text" runat="server" CssClass="text-error" style="color: #000000"/>
                </td>
            </tr>
        </table>
            </td>
            <td class="auto-style9" colspan="2"><strong>Thống kê trong tháng</strong></td>
        </tr>
        <tr>
            <td class="auto-style10">Sách mua nhiều nhất:</td>
            <td><asp:Label ID="lblSachNhat" runat="server"></asp:Label></td>
        </tr>
        <tr>
            <td class="auto-style10">Khách hàng mua nhiều nhất:</td>
            <td><asp:Label ID="lblKhachHangNhat" runat="server"></asp:Label></td>
        </tr>
        <tr>
            <td class="auto-style11">Loại sách bán chạy nhất:</td>
            <td class="auto-style4"><asp:Label ID="lblLoaiNhat" runat="server"></asp:Label></td>
        </tr>
        <tr>
            <td class="auto-style10">Tổng số lượng sách bán được:</td>
            <td><asp:Label ID="lblTongSoLuong" runat="server"></asp:Label></td>
        </tr>
        <tr>
            <td class="auto-style10">Tổng doanh thu:</td>
            <td>
                <asp:Label ID="lblTongDoanThu" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="auto-style12">
                    <asp:Label ID="lblTua" runat="server" style="color: #000000"/>
            </td>
            <td colspan="2" rowspan="2">
        <asp:Chart ID="chartThongKe" runat="server" Height="427px" Width="450px">
            <ChartAreas>
                <asp:ChartArea Name="ChartArea1">
                    <AxisX LineColor="DarkGray">
                        <MajorGrid LineColor="LightGray" />
                    </AxisX>
                    <AxisY LineColor="DarkGray">
                        <MajorGrid LineColor="LightGray" />
                    </AxisY>
                </asp:ChartArea>
            </ChartAreas>
            <Legends>
                <asp:Legend Name="Infomation" TitleAlignment="Near" Alignment="Center" Title="Chú thích"></asp:Legend>
            </Legends>
        </asp:Chart>
            </td>
        </tr>
        <tr>
            <td class="auto-style2">
                <asp:GridView ID="gdvThongKe" runat="server" Height="247px" Width="416px" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3">
                    <FooterStyle BackColor="White" ForeColor="#000066" />
                    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                    <RowStyle ForeColor="#000066" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#007DBB" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#00547E" />
                </asp:GridView>
            </td>
        </tr>
    </table>
</div>
</asp:Content>

